package com.evil.application.pojo.dto.form;

import com.evil.application.pojo.dto.form.enclosure.FormEnclosureDTO;
import com.evil.application.pojo.dto.form.rule.SnRuleRespDTO;
import com.evil.common.application.dto.form.ApplicationFormDTO;
import com.evil.common.application.dto.form.SpecialControlConfigDTO;
import com.evil.common.application.enums.PublishStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.util.List;

/**
 * 应用表单信息 返回实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ApplicationFormRespDTO extends ApplicationFormBaseRespDTO {

    /**
     * 描述|简介
     */
    private String formDescription;

    /**
     * 编号生成规则(0:默认, 1:自定义)
     */
    @NotNull(message = "编号生成规则参数不能为空")
    @Range(min = 0, max = 1, message = "参数错误")
    private Integer snRuleType;

    /**
     * 编号生成规则
     */
    @Valid
    private List<SnRuleRespDTO> snRules;

    /**
     * 表单附件
     */
    @Valid
    private List<FormEnclosureDTO> formEnclosures;

    /**
     * 发布状态{@link PublishStatusEnum}
     */
    private Integer publishStatus;

    /**
     * 特殊控件配置
     */
    private SpecialControlConfigDTO specialControlConfig;
}
